<?php self::header (); ?>
<div class="container">
    <div class="hero-unit">
      <div>
        <h1>
          Welcome to PassKey!
        </h1>
        <p style="margin-top: 15px; margin-bottom: 20px; margin-left: 5px;">
          PassKey manages your password and keys, so you don't have to.<br />
          It's also multi-user friendly, letting you safely share sensitive data with those you trust.<br />
          Login below to begin ... or if you're a new user - <a href="<?php print URL; ?>/account/create">create a new account</a>.
        </p>
      </div>
      <form action="<?php print URL; ?>/account/login" method="post">
        <input name="username" type="text" placeholder="Username" <?php if (isset ($data['errors']['no_username'])): ?>style="background-color: #ffe0e0"<?php endif; ?> />
        <input name="password" type="password" placeholder="Password" <?php if (isset ($data['errors']['no_password'])): ?>style="background-color: #ffe0e0"<?php endif; ?> />
        <input type="submit" class="btn btn-primary" style="position: relative; top: -5px;" name="login" value="Login" />
        
		  <?php if (isset ($data['errors']['wrong_credentials'])): ?>
		  <span style="margin-left: 20px;" class="text-center text-error">Wrong username and / or password.</span>
		  <?php endif; ?>
	  
		  <?php if (isset ($data['errors']['database_error'])): ?>
		  <span style="margin-left: 20px;" class="text-center text-error">
			  <?php self::eprint ($data['errors']['database_error']); ?>
		  </span>
		  <?php endif; ?>
	  
		  <?php if (isset ($data['logout'])): ?>
		  <span style="margin-left: 20px;" class="text-center text-info">You are now logged out.</span>
		  <?php endif; ?>
      </form>
    </div>
</div>
<?php self::footer (); ?>